package com.sbillings.messenger.hub.mocks;

import com.sbillings.messenger.hub.Message;
import com.sbillings.messenger.hub.Subscriber;
import com.sbillings.messenger.hub.NotificationStrategy;

/**
 * A Mock NotificationStrategy, used for unit testing.
 * @author steve.billings
 *
 */
public class MockNotificationStrategy implements NotificationStrategy {
	private Subscriber currentSubscriber;
	private Message currentMessage;

	public void sendMessage(Subscriber subscriber, Message message) {
		this.currentSubscriber = subscriber;
		this.currentMessage = message;
		System.out.println("Notifying " + subscriber.toString() + " with of message " + message.toString());
	}
	
	public Subscriber getLastSubscriber() {
		return this.currentSubscriber;
	}
	
	public Message getLastMessage() {
		return this.currentMessage;
	}
}
